cd $(dirname $0)
#系统目录
DIR="${DIR:-$HOME}"
unset LD_PRELOAD
# proot
command="proot"
command+=" --sysvipc"
command+=" --kill-on-exit"
command+=" --link2symlink"
command+=" -p"
command+=" -L"
command+=" -H"

# 根目录文件夹
command+=" -r ${DIR}/rootfs/"
#伪造内核版本信息
command+=" -k 5.10.105-3-cloud-arm64"
#伪装root权限
command+=" --root-id"
#打印日志
#command+=" --verbose=-1"
#挂载sdcard
command+=" -b /sdcard:/sdcard"
#command+=" -n 0"
# 指定一些目录
command+=" -b /dev"
command+=" -b /proc"
command+=" -b /sys"
command+=" -b /apex"
#proc目录
if [ -d ${DIR}/rootfs/MT/proc ]; then
  for file in `ls ${DIR}/rootfs/MT/proc`
  do
    command+=" -b ${DIR}/rootfs/MT/proc/${file}:/proc/${file}"
  done
fi


command+=" -b ${DIR}/rootfs/MT/proc/bus/pci/00:/proc/bus/pci/00"
command+=" -b ${DIR}/rootfs/MT/proc/bus/input/devices:/proc/bus/input/devices"

# 以下最好不要改动

#初始工作目录
command+=" -w /root /usr/bin/env"
command+=" -i HOME=/root"
command+=" PATH=/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games"
##修改语言
command+=" LANG=zh_CN.UTF-8"
##修改默认命令行 ps:已美化
command+=" /bin/bash --login"

echo "--------------------------------------------"
#exec $command